package com.orcamento.entity.report;

import java.util.ArrayList;
import java.util.List;

import com.orcamento.entity.Category;
import com.orcamento.entity.Event;
import com.orcamento.entity.Fund;
import com.orcamento.entity.Gain;
import com.orcamento.entity.Spent;
import com.orcamento.entity.enums.Month;

public abstract class Report {

	protected Month month;
	protected Integer year;
	
	protected List<Gain> gains = new ArrayList<Gain>();
	protected List<Spent> spents = new ArrayList<Spent>();
	protected List<Category> categories = new ArrayList<Category>();
	protected List<Fund> funds = new ArrayList<Fund>();
	protected List<Event> events = new ArrayList<Event>();

	public Report(Month month, Integer year) {
		this.month = month;
		this.year = year;
	}

	public abstract void generate();
	
	public void excludeCreditCardSpents() {
		List<Spent> spentWithoutCreditCard = new ArrayList<Spent>(); 
		for( Spent spent: spents ) {
			if( ! spent.isCreditCardPayment() ) {
				spentWithoutCreditCard.add( spent );
			}
		}
		this.spents = spentWithoutCreditCard;
	}
	
	public Month getMonth() {
		return month;
	}

	public List<Gain> getGains() {
		return gains;
	}

	public void setGains(List<Gain> gainsFlow) {
		this.gains = gainsFlow;
	}

	public List<Spent> getSpents() {
		return spents;
	}

	public void setSpents(List<Spent> spentsFlow) {
		this.spents = spentsFlow;
	}

	public List<Fund> getFunds() {
		return funds;
	}

	public void setFunds(List<Fund> funds) {
		this.funds = funds;
	}

	public Integer getYear() {
		return year;
	}

	public void setYear(Integer year) {
		this.year = year;
	}

	public List<Event> getEvents() {
		return events;
	}

	public void setEvents(List<Event> events) {
		this.events = events;
	}
	
	public void setCategories(List<Category> categoryFlow) {
		this.categories  = categoryFlow;
	}
	
	public List<Category> getCategories() {
		return categories;
	}
	
}
